import axios from 'axios'

axios.defaults.timeout = 5000;
axios.defaults.baseURL = "http://localhost:3118";
axios.defaults.headers.post["Content-Type"] = 'application/x-www-form-urlencoded;charset=UTF-8';

axios.interceptors.request.use(config => {
    return config;
}, error => {
    return error;
});

axios.interceptors.response.use(config => {
    return config;
}, error => {
    return error;
});

let api = {
    login: param => {
        return axios.post("/user/login", param);
    },
    order: {
        getItem: param => { return axios.get("/order/GetItem", { params: param });}
    }
}

export default api

